﻿using GN.Pay.TradeChannel.WeiXin.Request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.TradeChannel.WeiXin
{
    [Serializable]
    public class WeiXinAPPService : WeiXinServiceBase
    {
        public override string ChannelId
        {
            get
            {
                return "WeiXin.APP";
            }
        }

        public override ChannelType ChannelType
        {
            get
            {
                return ChannelType.NativeApp;
            }
        }

        public override string ChannelName
        {
            get
            {
                return "微信APP支付";
            }
        }
        public override string TradeType
        {
            get
            {
                return "APP";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public override bool IsPayNewRequest
        {
            get
            {
                return false;
            }
        }


        /// <summary>
        /// 申请微信APP付款
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public override ITradePayApplyResult PayApply(IOrderPayApply order)
        {
            var config = this.channelConfigure;
            var request = new AppPayRequest(this, order, config);
            return request.Build(this, config);
        }
    }
}
